#ifndef GAMECOIN_H
#define GAMECOIN_H

#include <QPushButton>
#include <QTimer>

class GameCoin : public QPushButton
{
    Q_OBJECT
public:
    explicit GameCoin(QString img, QWidget *parent = nullptr);

    void changeFlag();

    int posX() const;
    void setPosX(int newPosX);

    int posY() const;
    void setPosY(int newPosY);

    bool flag() const;
    void setFlag(bool newFlag);

    bool isWin() const;
    void setIsWin(bool newIsWin);

signals:

protected:
    void mousePressEvent(QMouseEvent *e);
private:
    int m_posX;
    int m_posY;
    bool m_flag;
    bool m_isAnimation;
    bool m_isWin;

    int m_minIndex;
    int m_maxIndex;
    QTimer *m_timerToFront;
    QTimer *m_timerToBack;
};

#endif // GAMECOIN_H
